﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Within circle out of Rectangle</title>
    <link href="styles/js-console.css" rel="stylesheet" />
</head>
<body>
    <div id="js-console"></div>
	<script src="scripts/js-console.js"></script>

    <script>
        var x = 3;
        var y = 2;
        var radius = 3;
        var line = Math.sqrt(x * x + y * y);
        var isInCircle = (radius >= line);
        var outOfRectangle = ((x < -1) || (x > 5) || (y > 1) || (y < -1));

        if (isInCircle) {
            jsConsole.writeLine("The point is within circle.");
        }
        else {
            jsConsole.writeLine("The point is out of circle.");
        }

        if (outOfRectangle) {
            jsConsole.writeLine("The point is ouf of rectangle");
        }
        else {
            jsConsole.writeLine("The point is within the rectangle.");
        }
    </script>
</body>
</html>
